From 0b105ebf1d77911104c2620692d14102eae825fc Mon Sep 17 00:00:00 2001 From: Jeroen De Dauw Date: Tue, 13 Dec 2011 19:51:03 +0000 Subject: [PATCH] added missing deprecation notices --- includes/LogPage.php | 2 ++ includes/Namespace.php | 1 + includes/ProxyTools.php | 4 +++- includes/Revision.php | 2 +- includes/SkinLegacy.php | 1 + includes/SpecialPage.php | 35 ++++++++++++++++++++++++++--------- includes/StubObject.php | 1 + includes/User.php | 7 ++++++- includes/WebRequest.php | 2 ++ includes/Wiki.php | 1 + includes/WikiError.php | 8 ++++---- includes/WikiPage.php | 6 +++++- 12 files changed, 53 insertions(+), 17 deletions(-) diff --git a/includes/LogPage.php b/includes/LogPage.php index 1fe0c6b344..f4dd064110 100644 --- a/includes/LogPage.php +++ b/includes/LogPage.php @@ -175,6 +175,7 @@ class LogPage { * @deprecated in 1.19, warnings in 1.21. Use getName() */ public static function logName( $type ) { + wfDeprecated( __METHOD__, '1.19' ); global $wgLogNames; if( isset( $wgLogNames[$type] ) ) { @@ -194,6 +195,7 @@ class LogPage { * @deprecated in 1.19, warnings in 1.21. Use getDescription() */ public static function logHeader( $type ) { + wfDeprecated( __METHOD__, '1.19' ); global $wgLogHeaders; return wfMsgExt( $wgLogHeaders[$type], array( 'parseinline' ) ); } diff --git a/includes/Namespace.php b/includes/Namespace.php index d32a53c39b..d203adf366 100644 --- a/includes/Namespace.php +++ b/includes/Namespace.php @@ -69,6 +69,7 @@ class MWNamespace { * @deprecated Please use the more consistently named isSubject (since 1.19) */ public static function isMain( $index ) { + wfDeprecated( __METHOD__, '1.19' ); return self::isSubject( $index ); } diff --git a/includes/ProxyTools.php b/includes/ProxyTools.php index bc01a6e8c1..bdab3be24f 100644 --- a/includes/ProxyTools.php +++ b/includes/ProxyTools.php @@ -13,6 +13,7 @@ * @return string */ function wfGetForwardedFor() { + wfDeprecated( __METHOD__, '1.19' ); global $wgRequest; return $wgRequest->getHeader( 'X-Forwarded-For' ); } @@ -25,7 +26,7 @@ function wfGetForwardedFor() { * @return string */ function wfGetAgent() { - wfDeprecated( __FUNCTION__ ); + wfDeprecated( __METHOD__, '1.18' ); global $wgRequest; return $wgRequest->getHeader( 'User-Agent' ); } @@ -38,6 +39,7 @@ function wfGetAgent() { * @return string */ function wfGetIP() { + wfDeprecated( __METHOD__, '1.19' ); global $wgRequest; return $wgRequest->getIP(); } diff --git a/includes/Revision.php b/includes/Revision.php index ae081634d7..3e06cfa8cc 100644 --- a/includes/Revision.php +++ b/includes/Revision.php @@ -728,7 +728,7 @@ class Revision { * @return String */ public function revText() { - wfDeprecated( __METHOD__ ); + wfDeprecated( __METHOD__, '1.17' ); return $this->getText( self::FOR_THIS_USER ); } diff --git a/includes/SkinLegacy.php b/includes/SkinLegacy.php index 56b2436425..77c85a88cb 100644 --- a/includes/SkinLegacy.php +++ b/includes/SkinLegacy.php @@ -532,6 +532,7 @@ class LegacyTemplate extends BaseTemplate { * @deprecated in 1.19 */ function getQuickbarCompensator( $rows = 1 ) { + wfDeprecated( __METHOD__, '1.19' ); return " "; } diff --git a/includes/SpecialPage.php b/includes/SpecialPage.php index 419c595125..853defe4f9 100644 --- a/includes/SpecialPage.php +++ b/includes/SpecialPage.php @@ -67,6 +67,7 @@ class SpecialPage { * @deprecated since 1.18 */ static function initList() { + wfDeprecated( __METHOD__, '1.18' ); // Noop } @@ -74,6 +75,7 @@ class SpecialPage { * @deprecated since 1.18 */ static function initAliasList() { + wfDeprecated( __METHOD__, '1.18' ); // Noop } @@ -86,6 +88,7 @@ class SpecialPage { * @deprecated since 1.18 call SpecialPageFactory method directly */ static function resolveAlias( $alias ) { + wfDeprecated( __METHOD__, '1.18' ); list( $name, /*...*/ ) = SpecialPageFactory::resolveAlias( $alias ); return $name; } @@ -112,7 +115,7 @@ class SpecialPage { * @deprecated since 1.7, warnings in 1.17, might be removed in 1.20 */ static function addPage( &$page ) { - wfDeprecated( __METHOD__ ); + wfDeprecated( __METHOD__, '1.7' ); SpecialPageFactory::getList()->{$page->mName} = $page; } @@ -125,6 +128,7 @@ class SpecialPage { * @deprecated since 1.18 call SpecialPageFactory method directly */ static function setGroup( $page, $group ) { + wfDeprecated( __METHOD__, '1.18' ); return SpecialPageFactory::setGroup( $page, $group ); } @@ -136,6 +140,7 @@ class SpecialPage { * @deprecated since 1.18 call SpecialPageFactory method directly */ static function getGroup( &$page ) { + wfDeprecated( __METHOD__, '1.18' ); return SpecialPageFactory::getGroup( $page ); } @@ -148,6 +153,7 @@ class SpecialPage { * @param $name String the page to remove */ static function removePage( $name ) { + wfDeprecated( __METHOD__, '1.18' ); unset( SpecialPageFactory::getList()->$name ); } @@ -159,6 +165,7 @@ class SpecialPage { * @deprecated since 1.18 call SpecialPageFactory method directly */ static function exists( $name ) { + wfDeprecated( __METHOD__, '1.18' ); return SpecialPageFactory::exists( $name ); } @@ -170,6 +177,7 @@ class SpecialPage { * @deprecated since 1.18 call SpecialPageFactory method directly */ static function getPage( $name ) { + wfDeprecated( __METHOD__, '1.18' ); return SpecialPageFactory::getPage( $name ); } @@ -182,6 +190,7 @@ class SpecialPage { * @deprecated since 1.18 call SpecialPageFactory method directly */ static function getPageByAlias( $alias ) { + wfDeprecated( __METHOD__, '1.18' ); return SpecialPageFactory::getPage( $alias ); } @@ -195,6 +204,7 @@ class SpecialPage { * @deprecated since 1.18 call SpecialPageFactory method directly */ static function getUsablePages( User $user = null ) { + wfDeprecated( __METHOD__, '1.18' ); return SpecialPageFactory::getUsablePages( $user ); } @@ -205,6 +215,7 @@ class SpecialPage { * @deprecated since 1.18 call SpecialPageFactory method directly */ static function getRegularPages() { + wfDeprecated( __METHOD__, '1.18' ); return SpecialPageFactory::getRegularPages(); } @@ -216,6 +227,7 @@ class SpecialPage { * @deprecated since 1.18 call SpecialPageFactory method directly */ static function getRestrictedPages() { + wfDeprecated( __METHOD__, '1.18' ); return SpecialPageFactory::getRestrictedPages(); } @@ -234,6 +246,7 @@ class SpecialPage { * @deprecated since 1.18 call SpecialPageFactory method directly */ public static function executePath( &$title, IContextSource &$context, $including = false ) { + wfDeprecated( __METHOD__, '1.18' ); return SpecialPageFactory::executePath( $title, $context, $including ); } @@ -247,6 +260,7 @@ class SpecialPage { * @deprecated since 1.18 call SpecialPageFactory method directly */ static function getLocalNameFor( $name, $subpage = false ) { + wfDeprecated( __METHOD__, '1.18' ); return SpecialPageFactory::getLocalNameFor( $name, $subpage ); } @@ -290,6 +304,7 @@ class SpecialPage { * @deprecated since 1.18 call SpecialPageFactory method directly */ static function getTitleForAlias( $alias ) { + wfDeprecated( __METHOD__, '1.18' ); return SpecialPageFactory::getTitleForAlias( $alias ); } @@ -353,11 +368,11 @@ class SpecialPage { * @deprecated since 1.17, call parent::__construct() */ public function __call( $fName, $a ) { + // Deprecated messages now, remove in 1.19 or 1.20? + wfDeprecated( __METHOD__, '1.17' ); + // Sometimes $fName is SpecialPage, sometimes it's specialpage. <3 PHP if( strtolower( $fName ) == 'specialpage' ) { - // Deprecated messages now, remove in 1.19 or 1.20? - wfDeprecated( __METHOD__ ); - $name = isset( $a[0] ) ? $a[0] : ''; $restriction = isset( $a[1] ) ? $a[1] : ''; $listed = isset( $a[2] ) ? $a[2] : true; @@ -395,6 +410,7 @@ class SpecialPage { * @deprecated since 1.18 */ function getFile() { + wfDeprecated( __METHOD__, '1.18' ); return $this->mFile; } @@ -441,11 +457,11 @@ class SpecialPage { * @return Mixed * @deprecated since 1.18 */ - function name( $x = null ) { return wfSetVar( $this->mName, $x ); } - function restriction( $x = null) { return wfSetVar( $this->mRestriction, $x ); } - function func( $x = null) { return wfSetVar( $this->mFunction, $x ); } - function file( $x = null) { return wfSetVar( $this->mFile, $x ); } - function includable( $x = null ) { return wfSetVar( $this->mIncludable, $x ); } + function name( $x = null ) { wfDeprecated( __METHOD__, '1.18' ); return wfSetVar( $this->mName, $x ); } + function restriction( $x = null) { wfDeprecated( __METHOD__, '1.18' ); return wfSetVar( $this->mRestriction, $x ); } + function func( $x = null) { wfDeprecated( __METHOD__, '1.18' ); return wfSetVar( $this->mFunction, $x ); } + function file( $x = null) { wfDeprecated( __METHOD__, '1.18' ); return wfSetVar( $this->mFile, $x ); } + function includable( $x = null ) { wfDeprecated( __METHOD__, '1.18' ); return wfSetVar( $this->mIncludable, $x ); } /** * Whether the special page is being evaluated via transclusion @@ -684,6 +700,7 @@ class SpecialPage { * @since 1.18 */ public function getLang() { + wfDeprecated( __METHOD__, '1.19' ); return $this->getLanguage(); } diff --git a/includes/StubObject.php b/includes/StubObject.php index 3f6b8b1370..647ad929ac 100644 --- a/includes/StubObject.php +++ b/includes/StubObject.php @@ -118,6 +118,7 @@ class StubObject { class StubContLang extends StubObject { function __construct() { + wfDeprecated( __CLASS__, '1.18' ); parent::__construct( 'wgContLang' ); } diff --git a/includes/User.php b/includes/User.php index 312a27bbf0..5d5e974410 100644 --- a/includes/User.php +++ b/includes/User.php @@ -730,6 +730,7 @@ class User { * @deprecated since 1.18 call Sanitizer::isValidEmail() directly */ public static function isValidEmailAddr( $addr ) { + wfDeprecated( __METHOD__, '1.18' ); return Sanitizer::validateEmail( $addr ); } @@ -2593,6 +2594,7 @@ class User { * @deprecated since 1.18 Use ->getSkin() in the most relevant outputting context you have */ public function getSkin() { + wfDeprecated( __METHOD__, '1.18' ); return RequestContext::getMain()->getSkin(); } @@ -2725,6 +2727,7 @@ class User { * @deprecated in 1.19 due to removal of user_options from the user table */ private function decodeOptions( $str ) { + wfDeprecated( __METHOD__, '1.19' ); if( !$str ) return; @@ -3012,11 +3015,12 @@ class User { * @return String Page rendering hash */ public function getPageRenderingHash() { + wfDeprecated( __METHOD__, '1.17' ); + global $wgUseDynamicDates, $wgRenderHashAppend, $wgLang, $wgContLang; if( $this->mHash ){ return $this->mHash; } - wfDeprecated( __METHOD__ ); // stubthreshold is only included below for completeness, // since it disables the parser cache, its value will always @@ -3189,6 +3193,7 @@ class User { * @return String The new edit token */ public function editToken( $salt = '', $request = null ) { + wfDeprecated( __METHOD__, '1.19' ); return $this->getEditToken( $salt, $request ); } diff --git a/includes/WebRequest.php b/includes/WebRequest.php index 0fada38e9a..65fe0c7b5e 100644 --- a/includes/WebRequest.php +++ b/includes/WebRequest.php @@ -743,6 +743,7 @@ class WebRequest { * @return integer */ public function getFileSize( $key ) { + wfDeprecated( __METHOD__, '1.17' ); $file = new WebRequestUpload( $this, $key ); return $file->getSize(); } @@ -955,6 +956,7 @@ HTML; * @return bool */ public function isPathInfoBad( $extWhitelist = array() ) { + wfDeprecated( __METHOD__, '1.17' ); global $wgScriptExtension; $extWhitelist[] = ltrim( $wgScriptExtension, '.' ); return IEUrlExtension::areServerVarsBad( $_SERVER, $extWhitelist ); diff --git a/includes/Wiki.php b/includes/Wiki.php index 0a4c0eaf81..e4e5b30ab8 100644 --- a/includes/Wiki.php +++ b/includes/Wiki.php @@ -289,6 +289,7 @@ class MediaWiki { * @return Article object */ public static function articleFromTitle( $title, IContextSource $context ) { + wfDeprecated( __METHOD__, '1.18' ); return Article::newFromTitle( $title, $context ); } diff --git a/includes/WikiError.php b/includes/WikiError.php index a634dff646..7c167f611b 100644 --- a/includes/WikiError.php +++ b/includes/WikiError.php @@ -35,7 +35,7 @@ class WikiError { * @deprecated since 1.17 */ function __construct( $message ) { - wfDeprecated( __METHOD__ ); + wfDeprecated( __METHOD__, '1.17' ); $this->mMessage = $message; } @@ -65,7 +65,7 @@ class WikiError { * @deprecated since 1.17 */ public static function isError( $object ) { - wfDeprecated( __METHOD__ ); + wfDeprecated( __METHOD__, '1.17' ); if ( $object instanceof WikiError ) { return true; } elseif ( $object instanceof Status ) { @@ -88,7 +88,7 @@ class WikiErrorMsg extends WikiError { * @deprecated since 1.17 */ function __construct( $message/*, ... */ ) { - wfDeprecated( __METHOD__ ); + wfDeprecated( __METHOD__, '1.17' ); $args = func_get_args(); array_shift( $args ); $this->mMessage = wfMsgReal( $message, $args, true ); @@ -120,7 +120,7 @@ class WikiXmlError extends WikiError { * @deprecated since 1.17 */ function __construct( $parser, $message = 'XML parsing error', $context = null, $offset = 0 ) { - wfDeprecated( __METHOD__ ); + wfDeprecated( __METHOD__, '1.17' ); $this->mXmlError = xml_get_error_code( $parser ); $this->mColumn = xml_get_current_column_number( $parser ); $this->mLine = xml_get_current_line_number( $parser ); diff --git a/includes/WikiPage.php b/includes/WikiPage.php index e5dbb0a71c..ac0ab02ff9 100644 --- a/includes/WikiPage.php +++ b/includes/WikiPage.php @@ -2157,6 +2157,7 @@ class WikiPage extends Page { * @deprecated since 1.18, use doEditUpdates() */ public function createUpdates( $rev ) { + wfDeprecated( __METHOD__, '1.18' ); global $wgUser; $this->doEditUpdates( $rev, $wgUser, array( 'created' => true ) ); } @@ -2176,7 +2177,7 @@ class WikiPage extends Page { public function preSaveTransform( $text, User $user = null, ParserOptions $popts = null ) { global $wgParser, $wgUser; - wfDeprecated( __METHOD__ ); + wfDeprecated( __METHOD__, '1.19' ); $user = is_null( $user ) ? $wgUser : $user; @@ -2686,6 +2687,7 @@ class WikiPage extends Page { * @deprecated since 1.18 */ public function quickEdit( $text, $comment = '', $minor = 0 ) { + wfDeprecated( __METHOD__, '1.18' ); global $wgUser; return $this->doQuickEdit( $text, $wgUser, $comment, $minor ); } @@ -2694,6 +2696,7 @@ class WikiPage extends Page { * @deprecated since 1.18 */ public function viewUpdates() { + wfDeprecated( __METHOD__, '1.18' ); global $wgUser; return $this->doViewUpdates( $wgUser ); } @@ -2702,6 +2705,7 @@ class WikiPage extends Page { * @deprecated since 1.18 */ public function useParserCache( $oldid ) { + wfDeprecated( __METHOD__, '1.18' ); global $wgUser; return $this->isParserCacheUsed( ParserOptions::newFromUser( $wgUser ), $oldid ); } -- 2.20.1